package presenter

import android.util.Log
import com.example.hospitalmanagementapp.BaseApplication
import com.example.hospitalmanagementapp.MessageResponse
import rx.android.schedulers.AndroidSchedulers
import rx.schedulers.Schedulers

class ISaltPresenter: SaltPresenter {
    override fun responseObj(mobile: String, OnMsmMessage: (MutableList<MessageResponse>) -> Unit) {
        //声明一个允许读写的集合容器
        var resultList= mutableListOf<MessageResponse>()
        BaseApplication.saltRequest.sendMessage(mobile)
            ?.subscribeOn(Schedulers.io())
            .observeOn(AndroidSchedulers.mainThread())
            .subscribe({
             resultList.add(it)
                Log.d("st", "${it.code.toString()+it.msg+it.data}")
            },
                {
                    Log.e("ISaltPresenter", it.message, it)
                },
                {

                })
    }
    }

